# -*- coding: utf-8 -*-
import sys
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(2, GPIO.OUT)
GPIO.setup(14,GPIO.OUT)
GPIO.setup(15,GPIO.OUT)
GPIO.setup(18,GPIO.OUT)
GPIO.setup(3,GPIO.OUT)
GPIO.setup(26,GPIO.OUT)
GPIO.setup(19,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(10,GPIO.OUT)
GPIO.setup(5,GPIO.OUT)
lights = {"1":2,"2":14,"3":15,"4":18,"5":3,"6":26,"7":19,"8":13,"9":10,"10":5}
if __name__=='__main__':
     commonds=sys.argv[1].split(":")
     #1:0 灯号:命令（开0:关1)
     flag=commonds[0] in lights
     if flag==True:
         if int(commonds[1])==0:
            GPIO.output(lights[commonds[0]], GPIO.LOW)
            input_value = GPIO.input(lights[commonds[0]])
            print u'灯控状态'+str(input_value)
         else:
            GPIO.output(lights[commonds[0]], GPIO.HIGH)
            input_value = GPIO.input(lights[commonds[0]])
            print u'灯控状态'+str(input_value)
     else:
